From: Colin Walters Date: Thu, 15 Jan 2015 03:18:00 +0000 (-0500) Subject: pull: Delete processed delta parts X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~983 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ebd03216a167e020a577a9f47ee1df3e45da8533;p=ostree.git pull: Delete processed delta parts Otherwise they stay around until a much later GC. --- diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 0c4e22b8..b5b780eb 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -857,6 +857,12 @@ static_deltapart_fetch_on_complete (GObject *object, delta_data = g_mapped_file_get_bytes (mfile); g_mapped_file_unref (mfile); + /* Unlink now while we're holding an open fd, so that on success + * or error, the file will be gone. This is particularly + * important if say we hit e.g. ENOSPC. + */ + (void) unlinkat (pull_data->tmpdir_dfd, temp_path, 0); + _ostree_static_delta_part_execute_async (pull_data->repo, fetch_data->objects, delta_data,